#!/usr/bin/python3
try:
	import os , sys, youtube_dl
	#link = sys.argv[1]
	link = input("cole o link aqui :")
	os.system("clear")

	print("Download Python")
	#opcao = str(input("1)[1920x1080] \n2)[1080x720] \n3)[640x360] \n4)[176x144] \n5)[mp3] \n6)[Se for video da(o) vimeo.com] \n7)[Sair]\n-> "))
	print("1) 1920x1080 [ youtube.com ]")
	print("2) 1080x720  [ youtube.com ]")
	print("3) 640x360   [ youtube.com ]")
	print("4) 176x144   [ youtube.com ]")
	print("5) 1080x720  [ vimeo.com   ]")
	print("6) 1080x720  [ xvideos.com ]")
	print("7) ???x???   [ animes/site ]")
	print("8) mp3 [youtube.com & vimeo.com]")
	print("9)[ Sair ]")
	opcao = str(input('-> '))

	if opcao == "1":
		os.system("mkdir -p youtube_py/")
		os.system("cd youtube_py/ && python3 -m youtube_dl -ci -f37 %s" %link)

	elif opcao == "2":
		os.system("mkdir -p youtube_py/")
		os.system("cd youtube_py/ && python3 -m youtube_dl -ci -f22 %s" %link)
	
	elif opcao == "3":
		os.system("mkdir -p youtube_py/")
		s.system("cd youtube_py/ && python3 -m youtube_dl -ci -f18 %s" %link)
	
	elif opcao == "4":
		os.system("mkdir -p youtube_py/")
		os.system("cd youtube_py/ && python3 -m youtube_dl -ci -f17 %s" %link)
	
	elif opcao == "5":
		os.system("mkdir -p vimeo_py/")
		os.system("cd vimeo_py/ && python3 -m youtube_dl -ci  %s" %link)
	elif opcao == "6":
		os.system("mkdir -p xvideos_py/")
		os.system("cd xvideos_py/ && python3 -m youtube_dl -ci  %s" %link)
	elif opcao == "7":
		os.system("mkdir -p animes_py/")
		os.system("cd animes_py/ && python3 -m youtube_dl -ci  %s" %link)
	
	elif opcao == "8":
		print("Pode demorar um pouco...")
		os.system("mkdir -p mp3/")
		os.system("cd mp3/ && python3 -m youtube_dl -ci  --extract-audio --audio-format mp3 %s" %link)
	
	elif opcao == "9":
		print("Saindo...")
	
	else:
		print("opcao errada !!!")
except:
	print("Colocar o link apos o script.py")
